"""
文件处理操作模块
"""

# 根据给定文件路径找到文件，读出文件的全部内容
def print_file_info(file_name):
    try:
        fr = open(file_name, 'r', encoding='utf-8')
        print(fr.read())
        fr.close()
    except FileNotFoundError:
        print("文件不存在")

def append_file_info(file_name, data):
    try:
        fw = open(file_name, 'a', encoding='utf-8')
        fw.write(data)
        fw.close()
    except Exception as e:
        print(e)

if __name__ == '__main__':
    print_file_info('14test.txt')
    append_file_info('14test.txt', '15my_utils_append_some_data\n')